package x.amadeus.admin.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import x.amadeus.admin.domain.Admin;
import x.amadeus.admin.mapper.AdminMapper;

import x.amadeus.student.domain.MyException;

@Service
public class AdminService {

	@Resource(name="adminMapper")
	private AdminMapper adminMapper;

	
	
	
	
	public Admin adminLogin(Admin form) throws MyException 
	{
		Admin admin = adminMapper.findByAusername(form.getAusername());
		if(admin==null) throw new MyException("管理员不存在");
		if(!admin.getApassword().equals(form.getApassword())) throw new MyException("密码错误");
		
		return admin;
	}


}
